<%-- 
    Document   : UserMain
    Created on : 10/10/2011, 04:01:52 PM
    Author     : Alumnos
--%>


<%@page import="Examen.lp1.Conexion"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<!DOCTYPE html>

        <html>
    <h<ead>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="UserSave.jsp">
            <br> <input type="hidden" name="go" value="Create">
            <br>UserId: <input type="text" name="userid">
            <br>Photo: <input type="text" name="photo">
            <br>Name : <input type="text" name="Name ">
            <br>Email: <input type="text" name="email">
            <br>Celular: <input type="text" name="celular">
            <br>Login: <input type="text" name="login">
            <br>Password: <input type="text" name="Password">
            <br>:Privilege <input type="text" name="privilege">
            <br>:ActiveAccount <input type="text" name="activeaccount">
            <br>:ForcePasswordChange <input type="text" name="forcePasswordChange">
            
            <br><input type="submit">
        </form>
<%
//main
        Conexion conn = new Conexion();
        try {           
            String qry="select * from User";
            PreparedStatement ps=conn.getConnection().prepareStatement(qry);
            ResultSet rs= ps.executeQuery();
            while(rs.next())
                out.println(
                        "<a href='UserForm.jsp?UserId="+rs.getString("UserId")+"'>Edit</a> "+
                        rs.getString("UserId")+ " "+
                        rs.getString("Photo")+ " "+
                        rs.getString("Name")+ " "+
                        rs.getString("Email")+ " "+
                        rs.getString("Celular")+ " "+
                        rs.getString("Login")+ " "+
                        rs.getString("Password")+ " "+
                        rs.getString("Privilege")+ " "+
                        rs.getString("ActiveAccount")+ " "+
                        rs.getString("ForcePasswordChange")+"<br>");
            conn.close();
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }       
%>        
    </body>
</html>

    </body>
</html>
